package A1_4_Shopsystem;

import java.util.List;
import java.util.ArrayList;

// 客户类
public class Customer {
    private String name;
    private String contact;
    private String deliveryAddress;
    private boolean active;
    private List<Order> orders; // 关联关系：一个客户有多个订单

    public Customer(String name, String contact, String deliveryAddress) {
        this.name = name;
        this.contact = contact;
        this.deliveryAddress = deliveryAddress;
        this.active = true;
        this.orders = new ArrayList<>();
    }

    // 添加订单
    public void addOrder(Order order) {
        this.orders.add(order);
    }

    // Getter 和 Setter 方法
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getContact() { return contact; }
    public void setContact(String contact) { this.contact = contact; }
    public String getDeliveryAddress() { return deliveryAddress; }
    public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; }
    public boolean isActive() { return active; }
    public void setActive(boolean active) { this.active = active; }
    public List<Order> getOrders() { return orders; }
}

